<?php

namespace App\Transformers\Teacher;

use League\Fractal\TransformerAbstract;
use App\Models\Teacher\Composition;

class CompositionTransformer extends TransformerAbstract
{

    public function transform(Composition $model)
    {
        return [
            'id'         => (int) $model->id,
            'teacher_id'=>$model->teacher_id,
            'acquire_date'=>$model->acquire_date,
            'title'=>$model->title,
            'summary'=>$model->summary,
            'use_honor_description'=>$model->use_honor_description,
            'write_description'=>$model->write_description,
            'created_user'=>$model->created_user,
            'updated_user'=>$model->updated_user,
            'remark'=>$model->remark,
            'created_at' => $model->created_at->format('Y-m-d H:i:s')
        ];
    }
}
